Repository navigation
fix(parser): unify indirect subscript consumption - #2734
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | c1fbd69 | Commit Preview URL Branch Preview URL |
Oct 15 2026, 06:29 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Indirect references and ordinary parameter expansions now agree on where an
array subscript ends, including escaped and quoted closing brackets. A resolved
indirect target must consume exactly one complete reference before an explicit
caller-supplied suffix is appended.
Indirect reparses also share request work/cancellation state, inherit enclosing
command-substitution depth, and propagate deferred child-parser errors.
Why
The separate indirect validator and parameter parser used different escape and
quote rules. Text admitted as one subscript could be reinterpreted as an operator
operand downstream. Sharing the scanner removes this grammar disagreement while
retaining the existing exact-reference and restricted-substitution policies.
Before / After
Two tiny ordinary parser fixtures failed before the fix: an escaped-bracket key
became an array access plus leftover literal text, and an explicitly supplied
default operator was attached at the wrong boundary. After the change the key
is one complete array reference and the explicit default remains attached to it.
Safe local validation is refreshed after merging current main
41ea8ab3intothe existing branch without rewriting history:
admission, shared work/cancellation, inherited depth, and two existing ordinary
parser compatibility checks.
associative keys, explicit default/slice Bash parity, and malformed ordinary
trailing text with session recovery.
No direct recursive/resource-exhaustion reproducer was executed or added. Normal
unchanged CI provides the repository's complete gate; no CI or test policy is
changed by this PR.
Risk
modern-Bash rejection of trailing indirect-target text is preserved.
cancellation, child depth, and error propagation. Canonical TM-DOS-135 and its
public summary are updated with the implementation.
Checklist